Skip to content

Remove duplicate code for COMMANDS_WITH_MQTT_P2P_HANDLING#931

Merged
edenhaus merged 1 commit into
devfrom
COMMANDS_WITH_MQTT_P2P_HANDLING-duplicate-code
Apr 28, 2025
Merged

Remove duplicate code for COMMANDS_WITH_MQTT_P2P_HANDLING#931
edenhaus merged 1 commit into
devfrom
COMMANDS_WITH_MQTT_P2P_HANDLING-duplicate-code

Conversation

@edenhaus

Copy link
Copy Markdown
Member

No description provided.

@edenhaus edenhaus added the pr: refactor PR with code refactoring label Apr 28, 2025
Copilot AI review requested due to automatic review settings April 28, 2025 09:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request removes duplicate code for the COMMANDS_WITH_MQTT_P2P_HANDLING mappings by eliminating redundant definitions from the XML and JSON command modules and consolidating their behavior in the root commands module.

  • Removed duplicate COMMANDS_WITH_MQTT_P2P_HANDLING definitions in deebot_client/commands/xml/init.py and deebot_client/commands/json/init.py
  • Consolidated COMMANDS_WITH_MQTT_P2P_HANDLING in deebot_client/commands/init.py using a dictionary comprehension based on the existing COMMANDS

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
deebot_client/commands/xml/init.py Removed redundant COMMANDS_WITH_MQTT_P2P_HANDLING code and updated type checking import.
deebot_client/commands/json/init.py Removed redundant COMMANDS_WITH_MQTT_P2P_HANDLING code and updated type checking import.
deebot_client/commands/init.py Consolidated the COMMANDS_WITH_MQTT_P2P_HANDLING mapping by iterating over COMMANDS, reducing duplication.

@codecov

codecov Bot commented Apr 28, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.84%. Comparing base (14c7a7c) to head (e47e0c7).
Report is 1 commits behind head on dev.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #931      +/-   ##
==========================================
- Coverage   92.85%   92.84%   -0.01%     
==========================================
  Files         125      125              
  Lines        4868     4865       -3     
  Branches      315      315              
==========================================
- Hits         4520     4517       -3     
  Misses        285      285              
  Partials       63       63              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq

codspeed-hq Bot commented Apr 28, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #931 will not alter performance

Comparing COMMANDS_WITH_MQTT_P2P_HANDLING-duplicate-code (e47e0c7) with dev (14c7a7c)

Summary

✅ 6 untouched benchmarks

@edenhaus edenhaus merged commit 8630f43 into dev Apr 28, 2025
27 checks passed
@edenhaus edenhaus deleted the COMMANDS_WITH_MQTT_P2P_HANDLING-duplicate-code branch April 28, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: refactor PR with code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants